const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
    app.use(
        '/api/admin',
        createProxyMiddleware({
            target: 'http://192.9.104.247:90',
            // target: 'https://map2020.tianditu.cn',
            changeOrigin: true,
        })
    );

    app.use(
        '/api/vgimap/2021/sync',
        createProxyMiddleware({
            target: 'http://192.9.104.19:9212/',
            changeOrigin: true,
        })
    );

    app.use(
        '/api/vgimap/2021',
        createProxyMiddleware({
            target: 'http://192.9.104.19:10300/',
            changeOrigin: true,
        })
    );

    // 农业
    app.use(
        '/webapi/2.0',
        createProxyMiddleware({
            // target: 'http://49.233.63.140:7012/',
            // target: 'http://120.27.22.250:7012/',
            target: 'http://59.110.61.23:7070/',
            changeOrigin: true,
        })
    );
    // app.use(
    //     '/webapi/2.0',
    //     createProxyMiddleware({
    //         target: 'http://82.156.55.198/',
    //         changeOrigin: true,
    //     })
    // );
};
